<script>
    function want_to(att) {
        //document.getElementById('CustomerDataDemand').value = att.value;
    }
</script>


<div class="row">

    <?php
    echo $this->Form->create('Customer', array(
        'novalidate' => true,
        'inputDefaults' => array(
            'error' => false
        )
    ));
    ?>
    <div class="row no-margin">
        <h4 class="uppercase border-bottom c-green">WANT SELL</h4>
        <?php //echo $this->Html->image('Resale_Want_to_sell_buy_rent-968x284.gif')?>
<!--        <div class="span12 no-margin">     
            <?php echo $this->Form->error('CustomerData.demand'); ?>
            <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                <?php echo $this->Form->hidden('CustomerData.demand'); ?>
                <label>
                    <input type="radio" name="data[CustomerData][demand]" id="CustomerDataDemandBuy" value="Buy" onclick="want_to(this);" checked/>
                    <span class="check"></span>
                    <b>Buy</b>
                </label>
            </div>
            <div class="input-control radio default-style margin10" data-role="input-control">
                <label>
                    <input type="radio" name="data[CustomerData][demand]" id="CustomerDataDemandSell" value="Sell" onclick="want_to(this);"/>
                    <span class="check"></span>
                    <b>Sell</b>
                </label>
            </div>
            <div class="input-control radio default-style margin10" data-role="input-control">
                <label>
                    <input type="radio" name="data[CustomerData][demand]" id="CustomerDataDemandRent" value="Rent" onclick="want_to(this);"/>
                    <span class="check"></span>
                    <b>Rent</b>
                </label>
            </div>

        </div>-->
    </div>

    <div class="row">
        <div class="span12">
            <!--            <h4 class="uppercase border-bottom c-green">select properties</h4>-->
            <?php echo $this->Form->error('CustomerData.property_type_id'); ?>
            <?php echo $this->Form->hidden('CustomerData.property_type_id'); ?>
            <h5 class="uppercase"><?php echo $properties[0]['Property']['name'] ?> or <?php echo $properties[1]['Property']['name'] ?> <font class="require"> *</font></h5>
            <table width="100%">                
                <tr>
                    <td valign="top" width="50%">
                        <?php 
                        $webLang = $this->Session->read('Config.language');
                        if($webLang == THAI_LANG){
                            $webLang = THAI_LANG_PRO;
                        }else{
                            $webLang = ENG_LANG_PRO;
                        }
                        ?>
                        <div class="span12">
                            <?php foreach ($properties[0]['PropertyType'] as $a): ?>
                                <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                                    <label>
                                        <input type="radio" name="data[CustomerData][property_type_id]" id="CustomerDataPropertyTypeId<?php echo h($a['id']) ?>" value="<?php echo h($a['id']) ?>" onclick=""/>
                                        <span class="check"></span>
                                        <?php echo h($a['type_name_' . strtolower($webLang)]) ?>
                                    </label>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </td>
                    <td valign="top" width="">
                        <div class="span12">
                            <?php foreach ($properties[1]['PropertyType'] as $a): ?>
                                <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                                    <label>
                                        <input type="radio" name="data[CustomerData][property_type_id]" id="CustomerDataPropertyTypeId<?php echo h($a['id']) ?>" value="<?php echo h($a['id']) ?>" onclick=""/>
                                        <span class="check"></span>
                                        <?php echo h($a['type_name_' . strtolower($webLang)]) ?>
                                    </label>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </td>
                </tr>   

            </table>
        </div>
    </div>

    <div class="row">
        <h5 class="uppercase">Preference</h5>
        <div class="span12 no-margin">
            <?php //echo $this->Form->hidden('CustomerData.preference'); ?>
            <?php foreach ($preferences as $a): ?>
                <div data-role="input-control" class="input-control checkbox margin-left">
                    <label>
                        <input type="checkbox" name="data[CustomerData][preference][]" value="<?php echo h($a) ?>">
                        <span class="check"></span>
                        <?php echo h($a) ?>
                    </label>
                </div>
            <?php endforeach; ?>
        </div>
    </div>

    <div class="row">
        <div class="span12">
            <h5 class="uppercase">Bedroom</h5>
            <?php echo $this->Form->hidden('CustomerData.bedroom'); ?>
            <?php foreach ($bedRooms as $a): ?>
                <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                    <label>
                        <input type="radio" name="data[CustomerData][bedroom]" value="<?php echo h($a) ?>"/>
                        <span class="check"></span>
                        <?php echo h($a) ?>
                    </label>
                </div>
            <?php endforeach; ?>
        </div>
    </div>

    <div class="row">
        <div class="span6">
            <h5 class="uppercase">Location <font class="require"> *</font></h5>
            <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                <label>
                    <input type="radio" name="data[CustomerData][location]" id="CustomerDataLocationChiangmai" value="Chiang mai" checked/>
                    <span class="check"></span>
                    Chiang mai
                </label>
            </div>
            <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                <label>
                    <input type="radio" name="data[CustomerData][location]" id="CustomerDataLocationBangkok" value="Bangkok"/>
                    <span class="check"></span>
                    Bangkok
                </label>
            </div>
            <div class="input-control radio default-style margin-left-rigth" data-role="input-control">
                <label>
                    <input type="radio" name="data[CustomerData][location]" id="CustomerDataLocationOthers" value="Others"/>
                    <span class="check"></span>
                    Others
                </label>
            </div>
        </div>
        <div class="span6">
            <table width="100%">
                <tr>
                    <td valign="top">
                        <h5 class="uppercase">Price Range</h5>
                        <?php echo $this->Form->error('CustomerData.price_start'); ?>
                        <div class="input-control text no-margin size2" data-role="input-control">
                            <?php
                            echo $this->Form->input('CustomerData.price_start', array(
                                'label' => false,
                                'maxlength' => '100',
                                'value'=>'0'
                            ));
                            ?>
                        </div>
                        TO
                        <?php echo $this->Form->error('CustomerData.price_end'); ?>
                        <div class="input-control text no-margin size2" data-role="input-control">
                            <?php
                            echo $this->Form->input('CustomerData.price_end', array(
                                'label' => false,
                                'maxlength' => '100',
                                'value'=>'0'
                            ));
                            ?>
                        </div>
                    </td>   
                </tr>  
            </table>
        </div>
    </div>

    <div class="row">
        <h4 class="uppercase border-bottom c-green">your information</h4>
        <div class="span12 no-margin">
            <table width="100%">
                <tr>
                    <td align="left"><?php echo __d($local, 'first_name'); ?><font class="require"> *</font></td>
                    <td>
                        <?php echo $this->Form->error('Customer.first_name'); ?>
                        <div class="input-control text no-margin" data-role="input-control">
                            <?php
                            echo $this->Form->input('Customer.first_name', array(
                                'label' => false,
                                'maxlength' => '100'
                            ));
                            ?>
                        </div>

                    </td>
                    <td align="right"><?php echo __d($local, 'last_name'); ?><font class="require"> *</font></td>
                    <td>
                        <?php echo $this->Form->error('Customer.last_name'); ?>
                        <div class="input-control text no-margin" data-role="input-control">
                            <?php
                            echo $this->Form->input('Customer.last_name', array(
                                'label' => false,
                                'maxlength' => '100'
                            ));
                            ?>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td><?php echo __d($local, 'email'); ?><font class="require"> *</font></td>
                    <td>
                        <?php echo $this->Form->error('Customer.email'); ?>
                        <div class="input-control text no-margin" data-role="input-control">
                            <?php
                            echo $this->Form->input('Customer.email', array(
                                'label' => false,
                                'maxlength' => '100'
                            ));
                            ?>
                        </div>
                    </td>
                    <td align="right"><?php echo __d($local, 'mobile'); ?><font class="require"> *</font></td>
                    <td>
                        <?php echo $this->Form->error('Customer.mobile'); ?>
                        <div class="input-control text no-margin" data-role="input-control">
                            <?php
                            echo $this->Form->input('Customer.mobile', array(
                                'label' => false,
                                'maxlength' => '100'
                            ));
                            ?>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td ><?php echo __d($local, 'tel'); ?></td>
                    <td>
                        <?php echo $this->Form->error('Customer.tel'); ?>
                        <div class="input-control text no-margin" data-role="input-control">
                            <?php
                            echo $this->Form->input('Customer.tel', array(
                                'label' => false,
                                'maxlength' => '100'
                            ));
                            ?>
                        </div>
                    </td>
                    <td align="right"><?php echo __d($local, 'fax'); ?></td>
                    <td>
                        <?php echo $this->Form->error('Customer.fax'); ?>
                        <div class="input-control text no-margin" data-role="input-control">
                            <?php
                            echo $this->Form->input('Customer.fax', array(
                                'label' => false,
                                'maxlength' => '100'
                            ));
                            ?>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>

    <div class="row">
        <div class="span12 text-center">
            <?php //echo $this->Form->submit(__d($local, 'SEND'), array('class' => 'button success', 'disabled' => 'disabled')); ?>
            <?php echo $this->Form->submit(__d($local, 'SEND'), array('class' => 'button success')); ?>
        </div>
    </div>




    <?php echo $this->Form->end(); ?> 

</div>